from exts import db


class WalletMoney(db.Model):
    __tablename__ = 'wallet'  # 表名
    # 钱包id
    id = db.Column(db.Integer, primary_key=True, unique=True, autoincrement=True)
    # 用户id
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    # 虚拟钱包地址
    money_localtion = db.Column(db.String(255))
    # 钱包余额  20A=B
    moneyA = db.Column(db.Float, default=0)
    moneyB = db.Column(db.Float, default=0)
    users = db.relationship('User', backref='user', uselist=False)

    def __str__(self):
        return self.money_localtion
